﻿<a href="#!/" class="btn">Back</a>

<div class="messages">
    <div class="message row">
        <div class="title span10">{{vm.topic.title}}</div>
        <div class="date span2">{{vm.topic.created | date: "medium"}}</div>
        <div class="contents span12">{{vm.topic.body}}</div>
        
        <div class="replies span12">
            <div class="reply" ng-repeat = "r in vm.topic.replies">
                <div class="created pull-right">{{r.created | date: "medium"}}</div>
                <div class="content">{{r.body}}
                </div>
            </div>
        </div>
    </div>
    
    <h3>Add Reply</h3>
    <form name="newReplyForm" novalidate ng-submit="vm.addReply()">
        <fieldset>
            <div>
            
                <label for="body">Body</label>
                <textarea name="body" rows="5" cols="30" ng-model="vm.newReply.body" required ng-minlength="15"></textarea>
                <span class="error" ng-show="newReplyForm.body.$error.required">*</span>
                <span class="error" ng-show="newReplyForm.body.$error.minlength">Minimum 15 Characters Long</span>

            </div>
        
            <div>
            
                <input type="submit" class="btn btn-primary" value="Save" ng-disabled="newReplyForm.$invalid"/>
               

            </div>
        </fieldset>
    </form>

</div>